<template>
  <div class="printForm">
    <div class="area-header">
      <span class="area-header-title">{{ $t('申请单') }}</span>
    </div>
    <table class="printTable">
      <tr>
        <td class="tit">{{ $t('申请标题') }}</td>
        <td colspan="3">{{ form.actTitle }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('项目名称') }}</td>
        <td>
          {{ form.dealName }}
        </td>
        <td class="tit">{{ $t('签约主体') }}</td>
        <td>
          {{ form.contractingEntity }}
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('融资金额 ') + $t('金额单位') }}</td>
        <td>
          {{ moneyFormat(form.amountOfFinancing, 'w') }}
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('融资摘要') }}</td>
        <td colspan="3">
          {{ form.financingSummary }}
        </td>
      </tr>
    </table>

    <FileView :list.sync="form.fileList" data-type="deal_financing_contract" :business-id="autoBusinessId($route.query.id, form)" :btn-show="!otherBtnHide" />
  </div>
</template>

<script>
  import { getDealFinancingContract } from '@/api/deal/financingProjects/dealFinancingContract'

  export default {
    data() {
      return {
        // 是否隐藏保存按钮
        btnHide: false,
        // 是否隐藏其他按钮
        otherBtnHide: false,
        form: {
          fileList: []
        },
        // 遮罩层
        loading: false,
        // 操作按钮默认不展示
        buttonShow: true
      }
    },
    created() {
      this.$bus.$emit('async_done')
    },
    methods: {
      // 初始化数据
      init(data) {
        this.loading = true
        if (data != null && data.id !== undefined) {
          getDealFinancingContract(data.id).then(response => {
            this.form = response.data
            this.loading = false
          })
        }
      }

    }

  }
</script>
